﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModifyProduct.aspx.cs" Inherits="Admin_Product_ModifyProduct" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <UC:Css ID="cssUc" runat="server" />
    <title>Product Management </title>
    <UC:Js ID="JSUc" runat="server" />
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/js/json2.js")%>"></script>
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/js/AddProduct.js")%>"></script>
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/admin/UEditor/themes/default/ueditor.css")%>"/>
</head>
<body class="admin-layout">
    <form name="form1" method="post" id="form1" enctype="multipart/form-data">
    <div class="wrap">
        <UC:HeaderAdmin ID="headerUc" runat="server" />
        <div class="main">
            <div id="left">
            </div>
            <div id="right">
                <div class="breadcrumb">
                    <a href="productList.aspx">产品列表</a> › 添加产品
                </div>
                <div id="content">
                    <div class="hd">
                        <h1 class="title">
                            添加产品</h1>
                    </div>
                    <div class="bd">
                        <fieldset>
                        <input id="productId" name="productId" type="hidden" value="<%=productId %>" />
                            <div class="form-item">
                                <label for="title">
                                    系列<span class="form-required">*</span></label>
                                <select id="SeriesId" name="SeriesId">
                                    <option value="0">请选择</option>
                                    <%
                                        for (int i = 0; i < serviesList.Count; i++)
                                        {
                                    %>
                                    <option  value="<%=serviesList[i].Id %>" <%=seriesId ==serviesList[i].Id ? "selected='selected'":"" %>><%=serviesList[i].Name %></option>
                                    <%
                                        }                                        
                                    %>
                                </select>
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    产品名称<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="Name" name="Name" value="<%=name %>" />
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    挖机型号<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="Model" name="Model" value="<%=model %>" />
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    铲斗容量<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="BucketCapacity" name="BucketCapacity" value="<%=bucketCapacity %>" />
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    工作重量<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="WorkWeight" name="WorkWeight"  value="<%=workWeight %>"  />
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    发动机机型<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="Engine" name="Engine" value="<%=engine %>"/>
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    净功率<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="Power" name="Power" value="<%=power %>"/>
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    适用工矿<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="ApplyTo" name="ApplyTo" value="<%=applyTo %>"/>
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    简短描述<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="ShortDescription  " name="ShortDescription" value="<%=shortDescription %>"/>
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    优势描述<span class="form-required">*</span></label>
                                <input type="text" class="text form-text" id="Advantage" name="Advantage" value="<%=advantage %>" />
                            </div>

                            <label for="title">
                                    描述<span class="">*</span></label>
                                <div style="width: 900px">
                                    <script type="text/plain" id="editor" name="Description">
                                        <p><%=description %></p>
                                    </script>
                                </div>


                            <div class="form-item">
                                <label for="title">
                                    上传flash<span class="form-required">*</span></label>
                                <a class="btn_upload fl" href="#"><span id="flashSpanButtonPlaceHolder"></span></a>
                                <input type="text" readonly="readonly" id="flashUrl" name="flashUrl" value="<%=flashUrl %>" />
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    使用手册<span class="form-required">*</span></label>
                                <a class="btn_upload" href="#"><span id="pdfspanButtonPlaceHolder"></span></a>
                                <input type="text" readonly="readonly" id="pdfUrl" name="pdfUrl" value="<%=pdfUrl %>" />
                            </div>
                            <div class="form-item">
                                <label for="title">
                                    上传图片<span class="form-required">*</span></label>
                                <div class="con_right">
                                    <a class="btn_upload fl" href="#"><span id="spanButtonPlaceholder"></span></a><b
                                        id="uploadDesc"></b>
                                    <div class="clear">
                                    </div>
                                    <br />
                                    <div id="thumbnails">
                                    </div>
                                </div>
                                <br />
                            </div>
                            <div class="form-item">
                                <input type="button" id="btnSubmit" value="Submit" onclick="AddProduct.popupSubmit();" />
                                <input type="submit" id="btnBack" value="Back" name="btnBack" />
                            </div>
                        </fieldset>
                    </div>
                </div>
            </div>
        </div>
        <UC:FooterAdmin ID="footerUc" runat="server" />
    </div>
    </form>
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/UEditor/third-party/swfupload/swfupload.js")%>"></script>
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/js/handlers.js")%>"></script>
    <script type="text/javascript">
        AddProduct.url = '<%=ResolveUrl("~/admin/Ajax/EditProductAjax.aspx") %>';
        AddProduct.listUrl = '<%=ResolveUrl("~/admin/Product/ProductList.aspx") %>';

        AddProduct.ajaxBtnUrl = '<%=ResolveUrl("~/admin/js/XPButtonNoText_72x22.png") %>';
        AddProduct.ajaxSwfUrl = '<%=ResolveUrl("~/admin/UEditor/third-party/swfupload/swfupload.swf") %>';

        AddProduct.ajaxImgUrl = '<%=ResolveUrl("~/admin/ajax/ImgUpload.aspx") %>';
        AddProduct.ajaxPdfUrl = '<%=ResolveUrl("~/admin/ajax/UploadPdfOrSwf.aspx") %>';
        AddProduct.ajaxFlashUrl = '<%=ResolveUrl("~/admin/ajax/UploadPdfOrSwf.aspx") %>';

        var ASPSESSID = "<%=Session.SessionID %>";
        <%
        string imgJson ="";
        for(int i = 0 ;i< imags.Count;i++)
        {
            imgJson = Common.JsonHelper.Serialize<LLFM.CAT.Model.M_SeriesImages>(imags[i]);
            %>
                var strJson = <%=imgJson %>
                photoArrayList.push(strJson);
                 CreateImgItem(strJson);
            <%
        }
         %>

    </script>
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/js/swfFile.js")%>"></script>
    <script type="text/javascript">
        swfImg.setFileUploadLimit(5-<%=imags.Count%>);
    </script>
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/UEditor/editor_all.js")%>"></script>
    <script type="text/javascript" src="<%=ResolveUrl("~/admin/UEditor/editor_config.js")%>"></script>
    <script type="text/javascript">
        var editor = new baidu.editor.ui.Editor({
            toolbars: [['FullScreen', 'Source', '|', 'Undo', 'Redo', '|',
                'Bold', 'Italic', 'Underline', 'StrikeThrough', 'Superscript',
                'Subscript', 'RemoveFormat', 'FormatMatch', 'AutoTypeSet', '|',
                'PastePlain', '|', 'ForeColor', 'BackColor', 'InsertOrderedList',
                'InsertUnorderedList', 'SelectAll', 'ClearDoc', '|', 'FontFamily',
                'FontSize', '|', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyJustify', '|',
                'ImageNone', 'ImageLeft', 'ImageRight', 'ImageCenter', '|', 'InsertImage',
                 'attachment', 'Emotion', '|', 'InsertTable', 'DeleteTable', '|',
                'Horizontal', 'Date', 'Time', '|', 'Print', 'Preview', 'SearchReplace', 'Help']],
            elementPathEnabled: false,
            textarea: 'editorValue',
            emotionLocalization: true,
            autoHeightEnabled: false,
            maximumWords: 500
        });
        editor.render('editor');
    </script>
</body>
</html>

